package com.dcy.znoa.controller.publiz;

import com.dcy.znoa.common.annotation.AuthenticationAPI;
import com.dcy.znoa.common.controller.BaseController;
import com.dcy.znoa.common.exception.BusinessException;
import com.dcy.znoa.common.util.pojo.JsonForList;
import com.dcy.znoa.service.dic.AreaService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.io.UnsupportedEncodingException;


@Controller
@RequestMapping("area")
public class AreaController extends BaseController{
    @Autowired
    AreaService areaService;

//    @AuthenticationAPI
    @ResponseBody
    @RequestMapping("/getAll")
    public JsonForList getAll() throws BusinessException, IllegalAccessException, InstantiationException, UnsupportedEncodingException {
//        this.getCurrentUser().getOperId();
//        return success(userService.getById(operId));

//        if(getCurrentUser() == null){
//            throw  new BusinessException("304","用户session过期");
//        }
        return areaService.getAll();
    }
/*

@ResponseBody
@RequestMapping("/user/list")
public Result getUserById(Oper user) throws BusinessException{
return success(userService.selectOperList(user));
}
*/
}
